/*********************************************************************************
 * Copyright (C) 2022-present ISCAS & CESI.
 * PUACleaner is licensed under MulanPSL-2.0.
 * You can use this software according to the terms and conditions of the MulanPSL-2.0.
 * You may obtain a copy of MulanPSL-2.0 at:
 *          http://license.coscl.org.cn/MulanPSL2
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the MulanPSL-2.0 for more details.
 *********************************************************************************/

import cn.puacleaner.PuaCleaner;
import cn.puacleaner.PuaCleanerFactory;

public class Main {
    public static void main(String[] args) {
        System.out.println("Usage:");
        System.out.println(String.format("Params: type input_file output_file"));
        System.out.print("type: ");
        System.out.print("geshuiPUA ");
        System.out.print("rkxxPUA ");
        System.out.print("sogouPUA ");
        System.out.print("whshebaoPUA ");
        System.out.println("rsksPUA ...");
        if(args.length < 3){
            System.exit(-1);
        }
        System.out.println();
        System.out.println(String.format("input Params: %s %s %s", args[0], args[1], args[2]));
        String strInputFileName = args[1];
        String strOutputFileName = args[2];

        System.out.println("working ...");

        PuaCleaner worker = PuaCleanerFactory.createPuaCleaner(args[0]);
        worker.cleanTextFile(strInputFileName, strOutputFileName);

        System.out.println("Done.");
    }
}
